package com.iuie.ns.datum.vo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.iuie.ns.system.vo.code.SysCodeInfoVO;

/**
 * @desc TODO
 * @createTime 2017年8月18日 上午11:20:08
 * @author iuie
 */
@Table(name = "NS_BLOG_INFO")
@Entity
public class BlogInfoVO implements Serializable{

    private static final long serialVersionUID = -717672218353371778L;

    @Id
	private Long blogId;

	private String blogName;

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date updateTime;

	private Integer visits=0;

	private String author;
	
	private String authorId;

	private String remarks;

	private SysCodeInfoVO blogType;

	@Transient
	private String text;
	
	private String mdContent;
	
	@Column(name="blog_attr", nullable=false)
	private String blogAttr;
	
	@JoinColumn(name="fileInfo",referencedColumnName="fileId")
	@OneToOne(fetch=FetchType.EAGER)
	private FileInfoVO fileInfo;
	
	private String bookId;

	private String link;

	public Long getBlogId() {
		return blogId;
	}

	public void setBlogId(Long blogId) {
		this.blogId = blogId;
	}

	public String getBlogName() {
		return blogName;
	}

	public void setBlogName(String blogName) {
		this.blogName = blogName;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Integer getVisits() {
		return visits;
	}

	public void setVisits(Integer visits) {
		this.visits = visits;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public SysCodeInfoVO getBlogType() {
		return blogType;
	}

	public void setBlogType(SysCodeInfoVO blogType) {
		this.blogType = blogType;
	}

	public FileInfoVO getFileInfo() {
		return fileInfo;
	}

	public void setFileInfo(FileInfoVO fileInfo) {
		this.fileInfo = fileInfo;
	}

	public String getLink() {
		return link;
	}

	public void setLink(String link) {
		this.link = link;
	}
	
    public String getAuthorId() {
        return authorId;
    }
    
    public void setAuthorId(String authorId) {
        this.authorId = authorId;
    }

    public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getMdContent() {
		return mdContent;
	}
	
	public void setMdContent(String mdContent) {
		this.mdContent = mdContent;
	}
	
	public String getBlogAttr() {
		return blogAttr;
	}
	
	public void setBlogAttr(String blogAttr) {
		this.blogAttr = blogAttr;
	}

	public Date getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getBookId() {
		return bookId;
	}

	public void setBookId(String bookId) {
		this.bookId = bookId;
	}

	@Override
	public String toString() {
		return "BlogInfoVO [blogId=" + blogId + ", blogName=" + blogName
				+ ", createTime=" + createTime + ", updateTime=" + updateTime
				+ ", visits=" + visits + ", author=" + author + ", authorId="
				+ authorId + ", remarks=" + remarks + ", blogType=" + blogType
				+ ", text=" + text + ", mdContent=" + mdContent + ", blogAttr="
				+ blogAttr + ", fileInfo=" + fileInfo + ", bookId=" + bookId
				+ ", link=" + link + "]";
	}
}
